package com.yfp.goods.controller;

import com.yfp.common.core.domain.R;
import com.yfp.goods.service.GoodsNutritiveService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 商品营养表(GoodsNutritive)表控制层
 *
 * 
 * @since 2023-12-20 22:22:54
 */
@Tag(name = "商品营养")
@RestController
@RequestMapping("goodsNutritive")
public class GoodsNutritiveController {
    /**
     * 服务对象
     */
    @Resource
    private GoodsNutritiveService goodsNutritiveService;


    /**
     * 按商品id查询
     *
     * @param goodsId 货物id
     * @return {@link R}
     */
    @Operation(summary = "按商品id查询商品营养")
    @GetMapping("{goodsId}")
    public R queryByGoodsId( @PathVariable String goodsId) {
        return R.ok(this.goodsNutritiveService.queryByGoodsId(goodsId));
    }


}

